cmake_minimum_required(VERSION 3.12)
project(demo)

enable_language(CXX)
set(CMAKE_CXX_STANDARD 11)


file(GLOB sources "${CMAKE_CURRENT_LIST_DIR}/src/*.cpp")
file(GLOB headers "${CMAKE_CURRENT_LIST_DIR}/src/*.h")

add_executable(run ${CMAKE_CURRENT_LIST_DIR}/src/main.cpp ${sources} ${headers})

find_package(OpenCV REQUIRED)
if (OpenCV_FOUND)
    include_directories(${OpenCV_INCLUDE_DIRS})
    target_link_libraries(run ${OpenCV_LIBS})
else (OpenCV_FOUND)
    message(FATAL_ERROR "OpenCV library not found!")
endif (OpenCV_FOUND)


# set(ncnn_DIR ${CMAKE_SOURCE_DIR}/ncnn-20210525-android-vulkan/${ANDROID_ABI}/lib/cmake/ncnn)


set(ncnn_DIR "/home/wj/ncnn-master/build/install/lib/cmake/ncnn")



find_package(ncnn REQUIRED)
if (NOT TARGET ncnn)
    message(WARNING "ncnn NOT FOUND!  Please set ncnn_DIR environment variable")
else ()
    message("ncnn FOUND ")
    target_link_libraries(run ncnn jsoncpp)
endif ()


